Skip to content

West Midlands | 26-Jan-ITP | Fida H Ali Zada | Sprint 2 | coursework/sprint-2#946

Open
alizada-dev wants to merge 12 commits intoCodeYourFuture:mainfrom
alizada-dev:coursework/sprint-2
Open

West Midlands | 26-Jan-ITP | Fida H Ali Zada | Sprint 2 | coursework/sprint-2#946
alizada-dev wants to merge 12 commits intoCodeYourFuture:mainfrom
alizada-dev:coursework/sprint-2

Conversation

@alizada-dev
Copy link

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Completed the Sprint-2 coursework exercises of the Structuring and Testing Data module.

@alizada-dev alizada-dev added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 9, 2026
@magarpratik magarpratik added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Feb 15, 2026
function calculateBMI(weight, height) {
// return the BMI of someone based off their weight and height
} No newline at end of file
let bmi = weight / (height * height);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed you've used let here and in most other places. Could we use another keyword which might be a better fit?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used const instead of let

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👌

Could you also review the other places where let is being used?

For reference, here is the CYF Code Style Guide.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I reviewed the other exercises and changed let to const here as well: const value = Number(penceString.slice(0, -1)) / 100; which was required.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👍 I can still see a few places where we can use const. Could you find them?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup! 👍

Could you review this file too?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe const is not suitable here:
let hours = Number(time.slice(0, 2));
let minutes = Number(time.slice(3, 5));
let ampm = hours >= 12 ? 'pm' : 'am';

because the variable value changes in the next lines of code. I changed these to const but gave error.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe one of them can be const because it is not reassigned. Could you work out which one?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, you got me there!! Thanks for pointing it out. Changed let to const in the ampm variable.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one! I've changed the label to complete now.

@magarpratik magarpratik added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Feb 15, 2026
@alizada-dev alizada-dev added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Feb 15, 2026
@magarpratik magarpratik added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Feb 15, 2026
@magarpratik magarpratik added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Feb 15, 2026
@alizada-dev alizada-dev added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Feb 15, 2026
@magarpratik magarpratik added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Feb 15, 2026
@alizada-dev alizada-dev added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Feb 15, 2026
@magarpratik magarpratik added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Feb 15, 2026
@alizada-dev alizada-dev added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Feb 16, 2026
@magarpratik magarpratik added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants